package com.muli.muwai.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muli.muwai.entity.IntfContract;
import com.muli.muwai.mapper.ContractMapper;
import com.muli.muwai.service.IntfContracttSrevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.List;
import java.util.Map;

@Service
public class ContractSreviceimpl extends ServiceImpl<ContractMapper, IntfContract> implements IntfContracttSrevice {


    @Autowired
    ContractMapper contractMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void Contractimport(List<IntfContract> contractList) {
        //插入9月1号之后的数据
        saveBatch(contractList);
    }

    @Override
    public void deleteData() {
        //删除9月1号之后的数据
        String s = "2020-09-01";
        QueryWrapper<IntfContract> queryWrapper = new QueryWrapper();
        queryWrapper.gt("create_time", s);
        int i = baseMapper.delete(queryWrapper);
        System.out.println(i);
    }


}
